#!/bin/sh
if [ "$ARCHOS" = "" ]
then
    case `uname -s` in
    Darwin)
        OS=darwin
        case `uname -m` in
        "Power Macintosh")
            ARCH=mac
            ;;
        *)
            ARCH=unknown
            ;;
        esac
        ;;    
    SunOS)
	case `uname -m` in
	sun4H)
	    ARCH=sun4H
	    ;;
	*)
	    ARCH=sun4
	    ;;
	esac
	OS=`uname -r`
	case $OS in
	4*)
	    OS=4
	    ;;
	5*)
	    OS=5
	    ;;
	esac
	;;
    Linux)
	OS=linux
	case `uname -m` in
	i686)
	    ARCH=x86
	    ;;
	x86_64)
	    ARCH=x86_64
	    ;;
	*)
	    ARCH=unknown
	    ;;
	esac
	;;
    AIX)
	ARCH=ibm
	OS=`uname -v`
	;;
    IRIX*)
	ARCH=sgi
	OS=`uname -r`
	case $OS in
	5*)
	    OS=5
	    ;;
	6*)
	    OS=6
	    ;;
	esac
	;;
    HP-UX)
	ARCH=hp
	# this might not work right
	    OS=`uname -r`
	case $OS in
	*10*)
	    OS=10
	    ;;
	*9*)
	    OS=9
	    ;;
	esac
	;;
    CYGWIN_NT-5.0)
        OS=cygwin
        case `uname -m` in
        i686)
            ARCH=x86
            ;;
        *)
            ARCH=unknown
            ;;
        esac
        ;;
    *)
	echo "Unknown ARCH"
	ARCH=none
	;;
	esac
	
    ARCHOS="$ARCH"_$OS
fi
echo $ARCHOS
